{php}
$catbanner=1;
include "ad_get.php";
{/php}

{if $categories}
	<table cellspacing="0" class="box">
	<tr>
		<th colspan="{$CAT_PER_ROW}">
		<div style="float:left;margin-top:4px;">{if $catname}{$catname}{else}{$smarty.const.LA_CATEGORIES}{/if}</div>
		{if $options}
			<div style="float:right"> <form method="get"><select name="region" onchange="submit();"><option value="-1">{$smarty.const.LA_REGION_CHOOSE_FIRST}</option>{$options}</select></form></div>
		{/if}
		</th>
	</tr>
	
	<tr>
	{foreach name=main item=category from=$categories} 
		{if $category.IMAGE != "default.gif"}
		<td width="{$TD_SIZE}%" class="category_none" valign="top"><img src="catimages/{$category.IMAGE}" alt="" hspace="2" />
		{else}
		<td width="{$TD_SIZE}%" class="category" valign="top">
		{/if}
		
		{$category.URL}<strong> {$category.CATEGORYNAME} ({$category.TOTAL_ADS})</strong></a><br />	
			
		 {if $category.SUBCATLIST}
	    	{foreach name=sub item=sub from=$category.SUBCATLIST} 
	    		<a href="{$sub.CATLINK}" title="{$sub.CATNAME_FULL}">{$sub.CATNAME}</a> 
	    		<small class="littleGray">{$sub.NUM}</small>{if !$smarty.foreach.sub.last},{/if}
	    	{/foreach}
	    {elseif $category.CATDESCRIPTION}
	    	<small>{$category.CATDESCRIPTION}</small>
	    {/if}
		</td>
		
		{if $category.BREAK && !$smarty.foreach.main.last}
			</tr><tr class="{cycle values="alt,"}">
		{/if}
		
		{if $smarty.foreach.main.last}
			{if $category.REMAIN_TD>0}
				<td colspan="{$category.REMAIN_TD}"></td>
			{/if}
		{/if}
		
	{/foreach} 
	</tr>
	</table>
{/if}